<template>
  <div id="nav">
    <!-- <el-button type="primary">Primary</el-button>
    <router-link to="/">Home</router-link> |
    <router-link to="/about">About</router-link> -->
  </div>
  <el-affix>
    <NavBar @search="search"></NavBar>
  </el-affix>


  <el-row :gutter="20">
    <!-- <el-col :span="18"> -->
    <el-col :xs="24" :sm="24" :md="18" :lg="18" :xl="18">
      <!-- <div class="grid-content bg-purple-dark"> -->
      <!-- 路由 -->
      <router-view />
      <!-- </div> -->
    </el-col>
    <!-- <el-col :span="6"> -->
    <el-col :xs="24" :sm="24" :md="6" :lg="6" :xl="6">
      <SideBar></SideBar>
    </el-col>
  </el-row>
  <!-- 回到顶部 -->
  <el-backtop :right="100" :bottom="100" />
</template>
<script lang="ts" setup>
import NavBar from '@/components/NavBar/NavBar.vue'
import SideBar from '@/components/SideBar/SideBar.vue'
import { ref } from 'vue-demi'
import router from './router';

const search = (searchText: String) => {
  console.log(searchText);
  router.push('/result')

}
</script>


<style lang="scss">

// layout样式
.el-row {
  margin-bottom: 20px;
}

.el-row:last-child {
  margin-bottom: 0;
}

.el-col {
  border-radius: 4px;
}

.grid-content {
  border-radius: 4px;
  min-height: 36px;
}

.bg-purple-dark {
  background-color: rgb(192, 132, 252);
}

//
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

#nav {
  // padding: 30px;

  a {
    font-weight: bold;
    color: #2c3e50;

    &.router-link-exact-active {
      color: #42b983;
    }
  }
}
</style>
